home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Education / Library Hyper Card Templates / Open Stack / Labels / background_2736.txt < prev    next >
Encoding:
Text File  |  1987-12-04  |  14.1 KB  |  569 lines

  1. -- background: 2736 from stack: in
  2. -- bmap block id: 3197
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. ----------------------- Hyper Library Routine -----------------------
  8.  
  9. on openCard
  10.   global bookNumber,fieldList, autoNumbering,tentativeBook
  11.   put the short date into field "today's Date"
  12.   if (script of this card is not empty) and (autoNumbering is true) then
  13.     if field "Book Number" is empty then
  14.       put bookNumber into field "Book Number"
  15.       put true into tentativeBook
  16.     end if
  17.   end if
  18. end openCard
  19.  
  20. on closeCard
  21.   global bookNumber,fieldList,tentativeBook
  22.  
  23.   if fieldList is not empty then
  24.     set cursor to 4
  25.     if tentativeBook is true then
  26.       put quote&"Book Number""e&"," after fieldList
  27.       add 1 to bookNumber
  28.       put false into tentativeBook
  29.     end if
  30.  
  31.     put char 1 to (length(fieldList) - 1) of fieldList into fieldList
  32.     put fieldList into tempFieldList
  33.     put 0 into index
  34.  
  35.     put name of target into targName
  36.     repeat until tempFieldList is empty
  37.       add 1 to index
  38.       put item 1 of tempFieldList into fldTemp
  39.       put "put field "&fldTemp&" of "&targName& " into var"&index into cmdLine
  40.       do cmdLine
  41.       put empty into item 1 of tempFieldList
  42.       put empty into char 1 of tempFieldList -- rid leading comma.
  43.     end repeat
  44.  
  45.     set lockScreen to true
  46.     set lockMessages to true
  47.     push card
  48.  
  49.     ----------------------- Circulation Card --------------------------
  50.     do line 5 of script of this card
  51.  
  52.     put empty into targetFieldList
  53.     repeat with indx = 1 to the number of fields
  54.       put (word 3 of name of field indx) & "," after targetFieldList
  55.     end repeat
  56.  
  57.     repeat with indx = 1 to index
  58.       put item indx of fieldList into tempItem
  59.       if tempItem is in targetFieldList then
  60.         put "put var"&indx&" into field "&tempItem into cmdLine
  61.         do cmdLine
  62.       end if
  63.     end repeat
  64.  
  65.     ---------------------- Catalog Screen -------------------------
  66.     do line 8 of script of this card
  67.  
  68.     put empty into targetFieldList
  69.     repeat with indx = 1 to the number of fields
  70.       put (word 3 of name of field indx) & "," after targetFieldList
  71.     end repeat
  72.  
  73.     repeat with indx = 1 to index
  74.       put item indx of fieldList into tempItem
  75.       if tempItem is in targetFieldList then
  76.         put "put var"&indx&" into field "&tempItem into cmdLine
  77.         do cmdLine
  78.       end if
  79.     end repeat
  80.     --------------------- Acquisition Screen ----------------------
  81.     do line 2 of script of this card
  82.  
  83.     put empty into targetFieldList
  84.     repeat with indx = 1 to the number of fields
  85.       put (word 3 of name of field indx) & "," after targetFieldList
  86.     end repeat
  87.  
  88.     repeat with indx = 1 to index
  89.       put item indx of fieldList into tempItem
  90.       if tempItem is in targetFieldList then
  91.         put "put var"&indx&" into field "&tempItem into cmdLine
  92.         do cmdLine
  93.       end if
  94.     end repeat
  95.     ------------------------------------------------------------------
  96.     pop card
  97.     set lockMessages to false
  98.     set lockScreen to false
  99.  
  100.   end if
  101.  
  102.   if tentativeBook is true then
  103.     put empty into field "Book Number"
  104.     put false into tentativeBook
  105.   end if
  106.  
  107.   put empty into fieldList
  108. end closeCard
  109.  
  110. on innerReplication
  111.   put field "title" into field "title2"
  112.   put field "author" into field "author2"
  113.   put field "Book Number" into field "Book Number2"
  114.   put field "Book Number" into field "Book Number3"
  115.   put field "Call Number" into field "Call Number2"
  116.   put field "Call Number" into field "Call Number3"
  117. end innerReplication
  118.  
  119. on newField
  120.   global fieldScript
  121.   put name of target into targName
  122.   if word 1 of targName is "bkgnd" then
  123.     ask "Name of field?"
  124.     put it into tmpFldName
  125.     if tmpFldName is empty then
  126.       answer "Unnamed; field will not copy to other stacks"
  127.     else
  128.       set name of targName to tmpFldName
  129.       set script of targName to fieldScript
  130.     end if
  131.   end if
  132. end newField
  133.  
  134. on doMenu parm
  135.   if name of this card is name of target then
  136.     if parm is "New Card" then
  137.       mkNewCard
  138.     else
  139.       if parm is "Delete Card" then
  140.         delCard
  141.       else
  142.         if parm is "New Field" then
  143.           set editBkgnd to true
  144.           pass doMenu
  145.         else
  146.           if parm is "Open Stack..." then
  147.             set cursor to 4
  148.             quit
  149.             pass doMenu
  150.           else
  151.             if parm is "Cut Card" then
  152.               -- cut card conditional
  153.             else
  154.               if parm is "Paste Card" then
  155.                 --
  156.               else
  157.                 pass doMenu
  158.               end if
  159.             end if
  160.           end if
  161.         end if
  162.       end if
  163.     end if
  164.   else
  165.     pass doMenu
  166.   end if
  167. end doMenu
  168. --------------------- End Open Stack Routine ---------------------------
  169.  
  170.  
  171.  
  172. -- part 1 (field)
  173. -- low flags: 00
  174. -- high flags: 4002
  175. -- rect: left=56 top=63 right=124 bottom=118
  176. -- title width / last selected line: 0
  177. -- icon id / first selected line: 0 / 0
  178. -- text alignment: 0
  179. -- font id: 4
  180. -- text size: 9
  181. -- style flags: 0
  182. -- line height: 12
  183. -- part name: Call number
  184. ----- HyperTalk script -----
  185. on closeField
  186.   global fieldList
  187.   put word 3 of name of me into tempName
  188.   if not(fieldList contains tempName) then
  189.     put (word 3 of name of me) & "," after fieldList
  190.   end if
  191. end closeField
  192.  
  193.  
  194. -- part 2 (field)
  195. -- low flags: 00
  196. -- high flags: 0002
  197. -- rect: left=55 top=133 right=145 bottom=117
  198. -- title width / last selected line: 0
  199. -- icon id / first selected line: 0 / 0
  200. -- text alignment: 0
  201. -- font id: 4
  202. -- text size: 9
  203. -- style flags: 0
  204. -- line height: 12
  205. -- part name: Book Number
  206. ----- HyperTalk script -----
  207. on closeField
  208.   global fieldList,bookNumber,tentativeBook
  209.   if tentativeBook is true then
  210.     put field "Book Number" into bookNumber
  211.   else
  212.  
  213.     put word 3 of name of me into tempName
  214.     if not(fieldList contains tempName) then
  215.       put (word 3 of name of me) & "," after fieldList
  216.     end if
  217.   end if
  218. end closeField
  219.  
  220.  
  221. -- part 3 (field)
  222. -- low flags: 00
  223. -- high flags: 0002
  224. -- rect: left=180 top=63 right=75 bottom=376
  225. -- title width / last selected line: 0
  226. -- icon id / first selected line: 0 / 0
  227. -- text alignment: 0
  228. -- font id: 4
  229. -- text size: 9
  230. -- style flags: 0
  231. -- line height: 12
  232. -- part name: Author
  233. ----- HyperTalk script -----
  234. on closeField
  235.   global fieldList
  236.   put word 3 of name of me into tempName
  237.   if not(fieldList contains tempName) then
  238.     put (word 3 of name of me) & "," after fieldList
  239.   end if
  240. end closeField
  241.  
  242.  
  243. -- part 4 (field)
  244. -- low flags: 00
  245. -- high flags: 4002
  246. -- rect: left=180 top=74 right=123 bottom=376
  247. -- title width / last selected line: 0
  248. -- icon id / first selected line: 0 / 0
  249. -- text alignment: 0
  250. -- font id: 4
  251. -- text size: 9
  252. -- style flags: 0
  253. -- line height: 12
  254. -- part name: Title
  255. ----- HyperTalk script -----
  256. on closeField
  257.   global fieldList
  258.   put word 3 of name of me into tempName
  259.   if not(fieldList contains tempName) then
  260.     put (word 3 of name of me) & "," after fieldList
  261.   end if
  262. end closeField
  263.  
  264.  
  265. -- part 5 (field)
  266. -- low flags: 00
  267. -- high flags: 0002
  268. -- rect: left=180 top=122 right=135 bottom=376
  269. -- title width / last selected line: 0
  270. -- icon id / first selected line: 0 / 0
  271. -- text alignment: 0
  272. -- font id: 4
  273. -- text size: 9
  274. -- style flags: 0
  275. -- line height: 12
  276. -- part name: Author2
  277. ----- HyperTalk script -----
  278. on closeField
  279.   global fieldList
  280.   put word 3 of name of me into tempName
  281.   if not(fieldList contains tempName) then
  282.     put (word 3 of name of me) & "," after fieldList
  283.   end if
  284. end closeField
  285.  
  286.  
  287. -- part 6 (field)
  288. -- low flags: 00
  289. -- high flags: 0002
  290. -- rect: left=180 top=135 right=183 bottom=376
  291. -- title width / last selected line: 0
  292. -- icon id / first selected line: 0 / 0
  293. -- text alignment: 0
  294. -- font id: 4
  295. -- text size: 9
  296. -- style flags: 0
  297. -- line height: 12
  298. -- part name: Title2
  299. ----- HyperTalk script -----
  300. on closeField
  301.   global fieldList
  302.   put word 3 of name of me into tempName
  303.   if not(fieldList contains tempName) then
  304.     put (word 3 of name of me) & "," after fieldList
  305.   end if
  306. end closeField
  307.  
  308.  
  309. -- part 8 (button)
  310. -- low flags: 00
  311. -- high flags: 0000
  312. -- rect: left=399 top=297 right=320 bottom=425
  313. -- title width / last selected line: 0
  314. -- icon id / first selected line: 9301 / 9301
  315. -- text alignment: 1
  316. -- font id: 0
  317. -- text size: 12
  318. -- style flags: 0
  319. -- line height: 16
  320. -- part name: Prev
  321. ----- HyperTalk script -----
  322. on mouseUp
  323.   go to prev card
  324. end mouseUp
  325.  
  326.  
  327.  
  328. -- part 9 (button)
  329. -- low flags: 00
  330. -- high flags: 0000
  331. -- rect: left=434 top=297 right=320 bottom=459
  332. -- title width / last selected line: 0
  333. -- icon id / first selected line: 27009 / 27009
  334. -- text alignment: 1
  335. -- font id: 0
  336. -- text size: 12
  337. -- style flags: 0
  338. -- line height: 16
  339. -- part name: Next
  340. ----- HyperTalk script -----
  341. on mouseUp
  342.   go to next card
  343. end mouseUp
  344.  
  345.  
  346.  
  347. -- part 10 (field)
  348. -- low flags: 00
  349. -- high flags: 0002
  350. -- rect: left=117 top=63 right=111 bottom=182
  351. -- title width / last selected line: 0
  352. -- icon id / first selected line: 0 / 0
  353. -- text alignment: 0
  354. -- font id: 4
  355. -- text size: 9
  356. -- style flags: 0
  357. -- line height: 12
  358. -- part name: Call Number2
  359. ----- HyperTalk script -----
  360. on closeField
  361.   global fieldList
  362.   put word 3 of name of me into tempName
  363.   if not(fieldList contains tempName) then
  364.     put (word 3 of name of me) & "," after fieldList
  365.   end if
  366. end closeField
  367.  
  368.  
  369. -- part 11 (field)
  370. -- low flags: 00
  371. -- high flags: 0002
  372. -- rect: left=117 top=122 right=170 bottom=182
  373. -- title width / last selected line: 0
  374. -- icon id / first selected line: 0 / 0
  375. -- text alignment: 0
  376. -- font id: 4
  377. -- text size: 9
  378. -- style flags: 0
  379. -- line height: 12
  380. -- part name: Call Number3
  381. ----- HyperTalk script -----
  382. on closeField
  383.   global fieldList
  384.   put word 3 of name of me into tempName
  385.   if not(fieldList contains tempName) then
  386.     put (word 3 of name of me) & "," after fieldList
  387.   end if
  388. end closeField
  389.  
  390.  
  391. -- part 12 (field)
  392. -- low flags: 00
  393. -- high flags: 0002
  394. -- rect: left=117 top=110 right=122 bottom=182
  395. -- title width / last selected line: 0
  396. -- icon id / first selected line: 0 / 0
  397. -- text alignment: 0
  398. -- font id: 4
  399. -- text size: 9
  400. -- style flags: 0
  401. -- line height: 12
  402. -- part name: Book Number2
  403. ----- HyperTalk script -----
  404. on closeField
  405.   global fieldList
  406.   put word 3 of name of me into tempName
  407.   if not(fieldList contains tempName) then
  408.     put (word 3 of name of me) & "," after fieldList
  409.   end if
  410. end closeField
  411.  
  412.  
  413. -- part 13 (field)
  414. -- low flags: 00
  415. -- high flags: 0002
  416. -- rect: left=117 top=170 right=183 bottom=182
  417. -- title width / last selected line: 0
  418. -- icon id / first selected line: 0 / 0
  419. -- text alignment: 0
  420. -- font id: 4
  421. -- text size: 9
  422. -- style flags: 0
  423. -- line height: 12
  424. -- part name: Book Number3
  425. ----- HyperTalk script -----
  426. on closeField
  427.   global fieldList
  428.   put word 3 of name of me into tempName
  429.   if not(fieldList contains tempName) then
  430.     put (word 3 of name of me) & "," after fieldList
  431.   end if
  432. end closeField
  433.  
  434.  
  435. -- part 14 (field)
  436. -- low flags: 00
  437. -- high flags: 0002
  438. -- rect: left=56 top=192 right=324 bottom=376
  439. -- title width / last selected line: 0
  440. -- icon id / first selected line: 0 / 0
  441. -- text alignment: 0
  442. -- font id: 4
  443. -- text size: 9
  444. -- style flags: 0
  445. -- line height: 12
  446. -- part name: NewField
  447. ----- HyperTalk script -----
  448. on closeField
  449.   global fieldList
  450.   put word 3 of name of me into tempName
  451.   if not(fieldList contains tempName) then
  452.     put (word 3 of name of me) & "," after fieldList
  453.   end if
  454. end closeField
  455.  
  456.  
  457. -- part 18 (button)
  458. -- low flags: 00
  459. -- high flags: 8003
  460. -- rect: left=403 top=35 right=113 bottom=504
  461. -- title width / last selected line: 0
  462. -- icon id / first selected line: 0 / 0
  463. -- text alignment: 1
  464. -- font id: 0
  465. -- text size: 12
  466. -- style flags: 0
  467. -- line height: 16
  468. -- part name: Acquisitions
  469. ----- HyperTalk script -----
  470. on mouseUp
  471.   goAcq
  472. end mouseUp
  473.  
  474.  
  475.  
  476. -- part 19 (button)
  477. -- low flags: 00
  478. -- high flags: 8003
  479. -- rect: left=406 top=121 right=198 bottom=504
  480. -- title width / last selected line: 0
  481. -- icon id / first selected line: 0 / 0
  482. -- text alignment: 1
  483. -- font id: 0
  484. -- text size: 12
  485. -- style flags: 0
  486. -- line height: 16
  487. -- part name: Print
  488. ----- HyperTalk script -----
  489. on mouseUp
  490.   set cursor to 4
  491.   innerReplication
  492.   -- set margins:
  493.   put 10 into firstMargin
  494.   put 20 into secondMargin
  495.   put 52 into thirdMargin
  496.  
  497.   put empty into tempFld
  498.   repeat with i = 1 to 10
  499.     put "                                                    " into line i of tempFld
  500.   end repeat
  501.  
  502.   -- temps to speed things up:
  503.   put thirdMargin - secondMargin -1 into thirdWidth
  504.   put firstMargin -1 into endOne
  505.   put firstMargin +1 into startTwo
  506.   put secondMargin +2 into startThree
  507.  
  508.   repeat with k = 1 to 5
  509.     put char 1 to endOne of line k of field "call number" into char 1 to endOne of line k of tempFld
  510.   end repeat
  511.  
  512.   put char 1 to endOne of field "Book Number" into char 1 to endOne of line 7 of tempFld
  513.  
  514.   put char 1 to endOne of field "Book Number2" into char startTwo to secondMargin of line 5 of tempFld
  515.  
  516.   put char 1 to endOne of field "Book Number3" into char startTwo to secondMargin of line 10 of tempFld
  517.  
  518.   repeat with k = 1 to 4
  519.     put char 1 to endOne of line k of field "call number2" into char firstMargin+1 to secondMargin of line k of tempFld
  520.     put char 1 to endOne of line k of field "call number3" into char startTwo to secondMargin of line k+5 of tempFld
  521.   end repeat
  522.  
  523.   put char 1 to thirdWidth of field "Author" into char startThree to thirdMargin of line 1 of tempFld
  524.  
  525.   put char 1 to thirdWidth of field "Author2" into char startThree to thirdMargin of line 6 of tempFld
  526.  
  527.   repeat with k = 1 to 4
  528.     put char 1 to thirdWidth of line k of field "Title" into char startThree to thirdMargin of line k+1 of tempFld
  529.  
  530.     put char 1 to thirdWidth of line k of field "Title2" into char startThree to thirdMargin of line k+6 of tempFld
  531.   end repeat
  532.  
  533.   put tempFld into field "newField"
  534. end mouseUp
  535.  
  536.  
  537.  
  538. -- part 23 (field)
  539. -- low flags: 01
  540. -- high flags: 0000
  541. -- rect: left=105 top=22 right=36 bottom=206
  542. -- title width / last selected line: 0
  543. -- icon id / first selected line: 0 / 0
  544. -- text alignment: 0
  545. -- font id: 3
  546. -- text size: 12
  547. -- style flags: 0
  548. -- line height: 16
  549. -- part name: Today's Date
  550.  
  551.  
  552. -- part 24 (button)
  553. -- low flags: 00
  554. -- high flags: 8003
  555. -- rect: left=405 top=238 right=260 bottom=505
  556. -- title width / last selected line: 0
  557. -- icon id / first selected line: 0 / 0
  558. -- text alignment: 1
  559. -- font id: 0
  560. -- text size: 12
  561. -- style flags: 0
  562. -- line height: 16
  563. -- part name: Control
  564. ----- HyperTalk script -----
  565. on mouseUp
  566.   go to stack "Control"
  567. end mouseUp
  568.  
  569.